/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.jasoet.model;

import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Deny Prasetyo
 */
@Entity
@Table
public class Transaksi implements java.io.Serializable {

    private static final long serialVersionUID = -193697144337963097L;
    @Id
    @Column(name = "id", length = 5, nullable = false, unique = true)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    @Temporal(TemporalType.DATE)
    private Date waktu;
    @OneToMany(mappedBy = "transaksi")
    private List<TransaksiDetail> transaksiDetails;
    @Column(name = "harga_total", length = 5, precision = 2)
    private double hargaTotal;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Date getWaktu() {
        return waktu;
    }

    public void setWaktu(Date waktu) {
        this.waktu = waktu;
    }

    public double getHargaTotal() {
        return hargaTotal;
    }

    public void setHargaTotal(double hargaTotal) {
        this.hargaTotal = hargaTotal;
    }

    public List<TransaksiDetail> getTransaksiDetails() {
        return transaksiDetails;
    }

    public void setTransaksiDetails(List<TransaksiDetail> transaksiDetails) {
        this.transaksiDetails = transaksiDetails;
    }
}
